<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>测试</title>
	<script type="text/javascript">

		str = "学并思daniuit视频下载地 址:bbs.daniuit.com，论坛地址： bbs.daniuit.com, 官daniuit方网址： www.daniuit.com";

		index = [];
		i = 0;
		while(true){

			if(i==0){
				start=0;
			}else{
				start =i+1;
			}

			i = str.indexOf("daniuit",start);

			if(i!='-1'){
				index.push(i);
			}else{
				break;
			}
		}

		// document.write(index);


		str ="NidfdegdHdrE";

		temp = "";

		for (var i = 0; i < str.length; i++) {
			if(str[i]==str[i].toUpperCase()){
				temp+=str[i].toLowerCase();
			}else{
				temp+=str[i].toUpperCase();
			}
		};

		// document.write(temp);



		temp = [];


		for (var i = 0; i < 7; i++) {
			is_exsit = false;
			num = Math.round((Math.random()*(47-1)+1));
			for (var k = 0; k<temp.length; k++) {

				if(temp[k]==num){
					is_exsit=true;
				}
			};

			if(is_exsit==true){
				i--;
			}else{
				temp.push(num);
			}
			
		};

		// document.write(temp);


		now = new Date()
		nowTime = Math.round(now.getTime()/1000);

		yundan = new Date('2018-01-01 00:00:00');

		yundanTime = Math.round(yundan.getTime()/1000);

		diffTime = yundanTime-nowTime;

		days = Math.floor(diffTime/86400);

		sy = diffTime%86400;

		hours = Math.floor(sy/3600);

		sy = sy%3600;

		min = Math.floor(sy/60);

		seconds = sy%60;

		document.write("天："+days);
		document.write("小时："+hours);
		document.write("分钟："+min);
		document.write("秒："+seconds);



















		// num1 = str.indexOf("daniuit");
		
		// num2 = str.indexOf("daniuit",num1+1);

		// num3 = str.indexOf("daniuit", num2+1);

		// alert(num3);



	</script>
</head>
<body>
	
</body>
</html>